#include <REGX52.H>
#include <INTRINS.H>

void Delay500ms(void)	//@12.000MHz
{
	unsigned char data i, j, k;

	_nop_();
	i = 4;
	j = 205;
	k = 187;
	do
	{
		do
		{
			while (--k);
		} while (--j);
	} while (--i);
}


int main()
{
	unsigned int led = 1;
  
	P2 = 0XFF;
	
	while(1)
	{
		P2 = (~led)&0XFF;
		
		Delay500ms();		

		led = led << 1;
		
		if(led == 0X100)
		{
			led = 1;
		}
	}
	return 0;
}
	
